{%include file="m.index.header.tpl.php"%}
<!--头部 end-->
<!--主体部分-->
<div class="container" style="margin-top:70px;">
    <div class="row" style="margin-top:10px;">
        <form action="" method="get">
            <div class="col-sm-12 distance" >
                <div class="form-group">
                    <label for="inputEmail3" class="col-sm-2 control-label">学年学期:</label>
                    <div class="col-sm-10">
                        <select class="form-control" name="semester_id" id="semester_id">
                            {%foreach from=$semester_lists key=key item=value%}
                            <option value="{%$value.semester_id%}"{%if $value.semester_id==$semester_id %}selected{%/if%}>{%$value.semester_xname%}{%$value.semester_name%}</option>
                            {%/foreach%}
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-sm-12 distance hierarchy" >
                <div class="form-group">
                    <label for="inputEmail3" class="col-sm-2 control-label">月份:</label>
                    <div class="col-sm-10">
                        <select class="form-control" id="semester_month" name="month_id">
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-xs-12  distance hierarchy2">
                <div class="form-group text-center" style="padding-top:0px;">
                    <input type="hidden" name="a" value="disease.monthdetails">
                    <button type="submit" class="btn btn-success" style="width:80%">搜索</button>
                </div>
            </div>
        </form>
    </div>
    <div class="row" style="margin-top:15px;margin-left:1px; margin-right:1px;">
        <h5 class="text-center" style="color:red; font-size:15px;">{%$semester_data.semester_name%}学生因病缺课主要症状第每月汇总表</h5>
        <h5  class="text-center">第{%$semester_month.semester_month%}月（{%$month_time.start_time%}至{%$month_time.end_time%}）</h5>
        <table class="table table-striped table-bordered text-center">
            <thead>
            <caption>
                地域类别:{%$baseset_data.baseset_registered%}   学校类型：{%$baseset_data.baseset_area%}
            </caption>
            <tr >
                <th colspan="3" class="text-center">全校学生应出勤人数</th>
            </tr>
            <tr>
                <td>男生{%$man_count.count%}人</td>
                <td>女生{%$woman_count%}人</td>
                <td>合计{%$student_count.count%}人</td>
            </tr>
            <!-- 全校学生应出勤人数:男生3人 女生4人 合计7人  学校因病缺课率：20% 填表人：胡歌-->

            </thead>

        </table>
        {%foreach from=$grade_lists key=key item=value%}
        <table class="table table-striped table-bordered text-center"  id="middles">
            <tr>
                <td>年级</td>
                <td>{%$value.grade_name%}</td>
            </tr>
            <tr>
                <td>因病缺课人数</td>
                <td><table class="table table-striped table-bordered text-center" >
                        <tr>
                            <td>男</td>
                            <td>{%$value.boy%}</td>
                        </tr>
                        <tr>
                            <td>女</td>
                            <td>{%$value.girl%}</td>
                        </tr>
                    </table></td>
            </tr>
            <tr>
                <td>因病缺课主要症状人次数</td>
                <td><table  class="table table-striped table-bordered text-center">
                        {%foreach from=$disease_ini key=key item=v name=foo%}
                        <tr>
                            <td>{%$v%}</td>
                            <td><table  class="table table-striped table-bordered text-center">
                                    <tr>
                                        <td>男</td>
                                        <td>{%$value.ball[$smarty.foreach.foo.index]%}</td>
                                    </tr>
                                    <tr>
                                        <td>女</td>
                                        <td>{%$value.gall[$smarty.foreach.foo.index]%}</td>
                                    </tr>
                                </table></td>
                        </tr>
                        {%/foreach%}
                    </table></td>
            </tr>
        </table>
        {%/foreach%}
        <table class="table table-striped table-bordered text-center">
            <tr>
                <th>备注:涉及到公交上</th>
            </tr>
        </table>
    </div>
</div>
<!--container  end-->
<!--主体部分  end-->
<!--底部-->
{%include file="m.index.footer.tpl.php"%}
<!--container  end-->
<script type="text/javascript">
    $(document).ready(function () {
        $("#semester_id").change(function () {
            if ($(this).val() == "-1") {
                $("#industr").remove(); return;
            }
            else {
                var timestamp = new Date().getTime();
                $.ajax({
                    url:"index.php?a=semester.MonthJson",
                    type:"get",
                    data: "semester_id=" + $("#semester_id").find("option:selected").val() + "&timestamp=" + timestamp,
                    dataType:"json",
                    success:function(msg){

                        //实例2个字符串变量来拼接下拉列表
                        var industr = "";
                        //使用jquery解析json中的数据
                        $.each(msg, function (n, value) {
                            industr += ("<option value=\"" + value.semester_month + "\">" + value.semester_month);
                            industr += ("</option>");
                        });

                        $("#semester_month").html(industr);
                    }
                });

            }

        });

    });
</script>
<!--底部end-->
<script src="mstatic/js/jquery.min.js" type="text/javascript"></script>
<script src="mstatic/js/bootstrap.min.js"  type="text/javascript"></script>
</body>
</html>
